﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using mfe.bll;

namespace mfe_proj.Forms
{
    public delegate void PublisherFormEventHandler(object sender, EventArgs e);
    public partial class PublisherForm : Form
    {
        public event PublisherFormEventHandler PublisherAdded;
        public PublisherForm()
        {
            InitializeComponent();
        }

        private void PublisherForm_Load(object sender, EventArgs e)
        {

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            Publisher p = new Publisher();
            p.PublisherGuidID = Guid.NewGuid().ToString();
            p.Name = txtName.Text.Trim();
            if (p.Save())
            {
                if (PublisherAdded != null) PublisherAdded(sender, e);
                Close();
            }
        }
    }
}
